-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to webview for previewing glTF files #123
Conversation
Hi @bghgary, thanks so much for this PR! Do you mind getting approval to sign our CLA? Jamie Marconi and David Catuhe and a few other Microsoft folks have done this. /cc #85 |
CLA sent. |
b489690
to
f234d64
Compare
CLA received, thanks @bghgary!! |
Thanks @bghgary. Currently can't compile. I suspect something is messed up on my side. Here's what I get:
Obviously these API points are supposed to exist. I tried |
Ahh, yes. Sorry, I missed adding a package.json change. |
This should work now. I was separating the rest of my changes from this PR and missed a couple of things. |
If I manually specify a reflection environment via the settings, for either Babylon or ThreeJS, I get CORS errors in the console and the environment won't load. VSCode User Settings file:
Output:
|
I like the persistence, you can cycle to other webviews and come back, and the page is still alive and doesn't need to reload. This could open the door to some interesting user interactions on the 3D view itself. Fixes #85. |
Yes, that's part of the reason why I'm doing this. I have code locally that interacts with the Babylon viewer. It's not quite yet, but I wanted to get the infrastructure merged in first. |
Shouldn't be needed those two systems are similar enough. |
Every webview panel gets created with a list of paths that it is allowed to access. I will probably make it such that the default environment's path is part of this list when the panel is created. The list of paths cannot be updated after the panel is created. This means that the default environment will not update until the preview window is closed and reopened. I think this is okay, but wanted to call it out. |
I think that's fine. Later we could add a trigger to destroy and create a new webview when that setting changes, if that becomes important. But I don't change it that often, probably I'll just close and reopen the window manually. For this PR that's fine. |
I've updated with the fix for the environment configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bghgary, this looks great.
Version 2.1.17 published. |
I have been working on a hackaton project to add a glTF debugger and I used the vscode extension as the foundation. This PR just does some clean up and switches the glTF preview to the vscode webview so that I can more easily pass messages to it. I have more changes coming.
I added the GLTF2.d.ts that I grabbed from the PR Don is submitting for DefinitelyTyped. We can switch over to the official one once that PR is merged.